import "babel-polyfill";
import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import Utils from "@/common/pakjUtils";
import "@/plugins/veeValidate";
// import '@/plugins/vconsole';

Vue.config.productionTip = false;
if (process.env.NODE_ENV === "production") {
  Vue.config.devtools = false;
} else {
  Vue.config.devtools = true;
}
// web-view下的页面内
function ready() {
  new Vue({
    router,
    store,
    render: (h) => h(App),
  }).$mount("#app");
}
if (Utils.isWeixinBroswer()) {
  console.log("检测到微信浏览器");
  if (!window.WeixinJSBridge || !WeixinJSBridge.invoke) {
    console.log("监听微信浏览器初始化信息");
    document.addEventListener("WeixinJSBridgeReady", ready, false);
  } else {
    console.log("检测到微信浏览器但是没有JSBridge");
    ready();
  }
} else {
  console.log("没有检测到微信浏览器");
  ready();
}
